import store from "@/store";

console.log(store)

export const defaultConfig = {
  cargoDimensions: 0, // 货物尺寸 长*宽*高
  companyId: 1,
  weight: 0,
  assignedLocationName: "",
  pieces: 1,
  nowPieces: 1,
  userId: "",
  widths: 0,
  longs: 0,
  heights: 0,
  extraFee: 0,
  volumeWeight: 0,
  cargoName: "",
  assignedLocationId: "",
  courierNumber: "",
  userName: "",
  advancePayment: 0,
  cargoQuantity: 0,
  cargoType: '海运普货',
  remarks: ''
}

export const itemStyle = {
  marginBottom: 0,
  padding: "0 0 0 10px",
};

// 表单配置项
export const formBase = [
  {
    type: "input",
    field: "cargoName",
    label: "货物名称",
    otherOptions: {},
  },
  {
    type: "input",
    field: "userName",
    label: "会员昵称",
    otherOptions: {
      disabled: true,
    },
  },
  {
    type: "select",
    field: "companyId",
    label: "快递公司",
    optionsKey: "companyName",
    optionsValue: "id",
    options: store.state.custom_dict.company,
    otherOptions: {
      disabled: false,
    },
  },
  {
    type: "select",
    field: "cargoType",
    label: "货物类型",
    optionsKey: "cargoName",
    optionsValue: "id",
    options: store.state.custom_dict.category,
    otherOptions: {},
  },
  {
    type: "inputNumber",
    field: "pieces",
    label: "快递件数",
    otherOptions: {
      step: 1,
      stepStrictly: true
    },
  },
  {
    type: "inputNumber",
    field: "cargoQuantity",
    label: "货物数量",
    otherOptions: {
      step: 1,
      stepStrictly: true
    },
  },
  {
    type: "inputNumber",
    field: "nowPieces",
    label: "当前件数",
    otherOptions: {
      step: 1,
      stepStrictly: true
    },
  },
  {
    type: "inputNumber",
    field: "extraFee",
    label: "超长收费",
    otherOptions: {
      disabled: true
    },
  },
  {
    type: "inputNumber",
    field: "advancePayment",
    label: "垫付费",
    otherOptions: {},
  },
  {
    type: 'input',
    field: 'remarks',
    label: '备注',
    otherOptions: {}
  }
]
